<template>
  <div class="Index">
    <ChinaMap></ChinaMap>


    <Left id="buttonleft" style="transition: all 1s"></Left>
    <div @click="pande" id="rights">{{ intertext }}</div>
    <!-- 右侧 -->
    <div id="buttonrightone" style="transition: all 5s">
    <Right></Right>
    </div>
    <div @click="panderight" id="rightsjian">{{ intertextright }}</div>
  </div>
</template>

<script>
import ChinaMap from "./ChinaMap";
import Left from "./left.vue";
import Right from "./right.vue";


export default {
  components: {
    ChinaMap,
    Left,
    Right
  },
  data() {
    return {
      drawersright: true,
      intertextright: ">",
      drawers: true,
      intertext: "<",
    };
  },
  methods: {
    // 右侧隐藏
    panderight() {
      // console.log(this.drawers);
      let rights = document.getElementById("rightsjian");
      let buttonright = document.getElementById("buttonrightone");
      if (this.drawersright) {
        this.drawersright = false;
        // this.intertextright = "<";
        rights.innerText = "<";
        // console.log(this.intertextright);
        rights.style.right = "40px";
        buttonright.style.opacity = 0;
        buttonright.style.transition = "all 0.5s";
        rights.style.transition = "all 0.5s";buttonright.style.zIndex=-99;
      } else {
        // this.intertextright = ">";
        // console.log(this.intertextright);
        rights.innerText = ">";buttonright.style.zIndex=99;
        this.drawersright = true;
        buttonright.style.opacity = 1;
        buttonright.style.transition = "all 0.5s";
        rights.style.right = "570px";
      }
    },
    pande() {
      console.log(this.drawers);
      let rights = document.getElementById("rights");
      let buttonright = document.getElementById("buttonleft");
      let buttonrights = document.getElementById("buttonrights");
      if (this.drawers) {
        this.drawers = false;
        this.intertext = ">";
        rights.style.left = "20px";
        buttonright.style.left = "-600px";
        buttonright.style.transition = "all 1s";
        buttonright.style.opacity = 0;
        buttonrights.style.left = "-600px";
        buttonrights.style.transition = "all 1s";
        rights.style.transition = "all 1s";buttonright.style.zIndex=-99;buttonrights.style.zIndex=-99;
      } else {
        this.intertext = "<";
        this.drawers = true;buttonright.style.zIndex=99;buttonright.style.zIndex=-99;
        rights.style.left = "520px";
        buttonright.style.left = "10px";
        buttonright.style.opacity = 1;
        buttonright.style.transition = "all 1s";
        buttonrights.style.left = "10px";
        buttonrights.style.transition = "all 1s";
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.Index {
  position: relative;
  /* position: fixed; */
  flex-flow: wrap;
}
.zhong {
  width: 400px;
  height: 500px;
  position: absolute;
  left: 0;
  right: 0;
  margin: auto;
  // border: solid 1px #020202;
  z-index: 99;
  // background: #ccc;
  top: -150px;
}
#buttonrightone {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 515px;
  // height: 945px;
  // overflow: hidden;
  // border-bottom: solid 1px #ccc;
}
#rightsjian {
  position: fixed;
  right: 548px;
  top: 50vh;
  /* bottom: 0px; */
  /* margin: auto; */
  width: 35px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background: rgb(253, 253, 253);
  cursor: pointer;
  border-radius: 10px 0 0 10px;
  font-size: 32px;
  font-weight: 500;
  color: #999999;
}

.Left {
  position: absolute;
  top: 20px;
  left: 20px;
}
.LeftBtn {
  position: absolute;
  top: 450px;
  left: 539px;
}
// .RightNext {
//   position: absolute;
//   top: 306px;
//   left: 1267px;
// }
.LeftNext {
  position: absolute;
  top: 306px;
  left: 20px;
}
#rights {
  box-shadow: 0px 0px 20px gainsboro;
  position: fixed;
  left: 520px;
  top: 50vh;
  width: 35px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background: rgb(253, 253, 253);
  cursor: pointer;
  border-radius: 0 10px 10px 0;
  font-size: 32px;
  color: #999999;
}
#rightsjian::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  background: #fff;
  /* transform: perspective(.5em) rotateX(5deg); */
  transform: perspective(0.5em) rotateY(-12deg);
  background: -webkit-gradient(
    linear,
    0 0,
    0 bottom,
    from(#f3f5f7),
    to(#fdfeff)
  );
}
#rights::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  background: #fff;
  /* transform: perspective(.5em) rotateX(5deg); */
  transform: perspective(0.5em) rotateY(12deg);
  background: -webkit-gradient(
    linear,
    0 0,
    0 bottom,
    from(#f3f5f7),
    to(#fdfeff)
  );
}
</style>
